<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('机械进场列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li class="select-time">
                                <p>进场时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginApproachTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endApproachTime]"/>
                            </li>
                            <li>
                                <p>劳务公司：</p>
                                <input type="text" name="labourComp"/>
                            </li>
                            <li>
                                <p>机械类型id：</p>
                                <input type="text" name="mechanicalTypeId"/>
                            </li>
                            <li>
                                <p>品牌：</p>
                                <input type="text" name="brand"/>
                            </li>
                            <li>
                                <p>机械型号：</p>
                                <input type="text" name="mechanicalModel"/>
                            </li>
                            <li>
                                <p>开始码表：</p>
                                <input type="text" name="startCodeTable"/>
                            </li>
                            <li>
                                <p>车牌：</p>
                                <input type="text" name="licensePlate"/>
                            </li>
                            <li>
                                <p>司机姓名：</p>
                                <input type="text" name="driverName"/>
                            </li>
                            <li>
                                <p>手机号码：</p>
                                <input type="text" name="phoneNum"/>
                            </li>
                            <li>
                                <p>工作类型id：</p>
                                <input type="text" name="typeWorkId"/>
                            </li>
                            <li>
                                <p>车架号：</p>
                                <input type="text" name="frameNum"/>
                            </li>
                            <li>
                                <p>挖机编号：</p>
                                <input type="text" name="excavatorNum"/>
                            </li>
                            <li>
                                <p>项目id：</p>
                                <input type="text" name="proId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="jixieapp:jixieapp:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="jixieapp:jixieapp:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="jixieapp:jixieapp:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="jixieapp:jixieapp:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('jixieapp:jixieapp:edit')}]];
        var removeFlag = [[${@permission.hasPermi('jixieapp:jixieapp:remove')}]];
        var prefix = ctx + "jixieapp/jixieapp";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "机械进场",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : '主键',
                    visible: false
                },
                {
                    field : 'approachTime', 
                    title : '进场时间'
                },
                {
                    field : 'labourComp', 
                    title : '劳务公司'
                },
                {
                    field : 'mechanicalTypeId', 
                    title : '机械类型id'
                },
                {
                    field : 'brand', 
                    title : '品牌'
                },
                {
                    field : 'mechanicalModel', 
                    title : '机械型号'
                },
                {
                    field : 'startCodeTable', 
                    title : '开始码表'
                },
                {
                    field : 'licensePlate', 
                    title : '车牌'
                },
                {
                    field : 'driverName', 
                    title : '司机姓名'
                },
                {
                    field : 'phoneNum', 
                    title : '手机号码'
                },
                {
                    field : 'typeWorkId', 
                    title : '工作类型id'
                },
                {
                    field : 'frameNum', 
                    title : '车架号'
                },
                {
                    field : 'excavatorNum', 
                    title : '挖机编号'
                },
                {
                    field : 'proId', 
                    title : '项目id'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>